import React, {
	Component,
} from 'react'
import { connect } from 'react-redux';
import { View, Text, Image, StyleSheet } from 'react-native'
import { ActionTypes } from '../constants'
import { VideoList } from '../components'

class PetItem extends Component {

	static propTypes = {
		
    };

	// 生命周期
	constructor(props) {
        super(props)
        const { item } = props
	    this.state = {
            item: item
	    }
    }
    
    componentDidMount() {
        this._fetchPetList()
    }

	// render part
	render() {
        console.log('petitem',this.props);
        
		return <VideoList
            data={this.props.videoList.works}
            navigation={this.props.navigation}
            // thumbsAction={this._thumbsAction.bind(this)}
            // playAction={this._playAction.bind(this)}
            // userDetailAction={this._userDetailAction.bind(this)}
        />
    }
    
    // thumbsAction: PropTypes.func,
    // playAction: PropTypes.func,
    // userDetailAction: 

    _fetchPetList() {
        const { id } = this.state.item || {};
        // const data = {
        //     uid: id
        // }
        // test
        const data = {
            uid: 1
        }
        const loadType = 0;
        actionUtil(ActionTypes.API_GET_PET_VIDEO_BY_PET_ID,{ data, loadType })
    }

    _thumbsAction() {

    }

    _playAction() {

    }

    _userDetailAction() {
        
    }
}

const styles = StyleSheet.create({
	
})

export default connect(state => ({
    petVideoList: state.videoList.petVideoList,
    videoList: state.videoList.videoList
})
)(PetItem)